﻿using System.Windows;
using System.Windows.Input;

namespace Hesehus
{
    public partial class Navigation
    {
        #region Field

        private readonly StartUp _window; 

        #endregion

        #region Creation

        public Navigation(StartUp window)
        {
            InitializeComponent();
            _window = window;
        } 

        #endregion

        #region Custom window handlers
        private void Close(object sender, MouseButtonEventArgs e)
        {
            _window.Close();
        }

        private void DragMove(object sender, MouseButtonEventArgs e)
        {
            _window.DragMove();
        }

        private void Minimize(object sender, MouseButtonEventArgs e)
        {
            _window.WindowState = WindowState.Minimized;
        }

        private void Normal(object sender, MouseButtonEventArgs e)
        {
            if (_window.windowState)
            {
                _window.WindowState = WindowState.Maximized;
                _window.windowState = false;
            }
            else
            {
                _window.WindowState = WindowState.Normal;
                _window.windowState = true;
            }
        }
        #endregion

        #region Events

        private void btnBackend_Click_1(object sender, RoutedEventArgs e)
        {
            _window.Content = new Backend(_window);
        }

        private void btnFrontend_Click_1(object sender, RoutedEventArgs e)
        {
            _window.Content = new Frontend(_window);
        } 

        #endregion
    }
}
